#ifndef COLLIDE_HPP
#define COLLIDE_HPP
#include "diary.hpp"
#include "object.hpp"
#include <random>
using namespace std;

#define POS_EQUAL(pos1, pos2) (pos1.x==pos2.x && pos1.y==pos2.y)

/* @brief 随机[low, high]区间上的整数值*/
int Rand(int low, int high);

/* @brief 随机[1, n]区间上的整数值*/
int D(int n);

/* @brief 碰撞的方法*/
//class CollideMethod{
//public:
//    virtual void Collide(Object* me, Object* other){}
//};

/* @brief 碰撞体的类型（或者说具有的碰撞属性，一个碰撞体可以有多个碰撞属性）*/
enum ColliType : Uint32{
    COLLI_UNKNOWN = 0x0000,
    COLLI_SOLID = 0x0001
};

/* @brief 所有可碰撞的类必须继承的类*/
class Collidable{
public:
    Collidable();
    bool HasColliType(ColliType type);
    void SetColliType(ColliType type);
    void UnsetColliType(ColliType type);
private:
    Uint32 _type;
};

#endif
